import AjaxSend from '@/pages/map/ajax/http';
import bus from '@/pages/map/ajax/bus';
/**
 * @Template 服务模板示例
 * interface:{  定义请求的名称，请保持唯一
 *  method: string, 请求方式（get、delete、head、post、put、patch）
 *  requestUrl: string, 请求的服务地址（在接口地址中'不'包含参数下使用，例如：'api/v1/user/'）
 *  requestCommon: function, 请求的服务地址（在接口地址中包含参数下使用，例如：'api/v1/users/' + params + '/active'）
 *  requestPost: function  返回对象类型，可以自己定义。（主要用于post请求也需要在url上面传参的方式；例如：'api/v1/user?id=param'，同时也有在body传参）
 * }
 */
const PublicObjService = {
  getUserInfo: {
    url: '/login/loginbyemail',
    method: 'post',
  },
  sysUserLogout: {
    url: '/login/loginbyemail',
    method: 'post'
  },
  queryOrganizationUser: {
    url: '/login/loginbyemail',
    method: 'post'
  },
  updateOrganizationUser: {
    url: '/login/loginbyemail',
    method: 'post'
  }
};

AjaxSend.loopServiceApi(PublicObjService)
export function getUserInfo() {
  return PublicObjService.userInfo.send();
}
export function sysUserLogout() {
  return PublicObjService.sysUserLogout.send();
}
export function queryOrganizationUser(organization_id, pageNumber, pageSize) {
  return PublicObjService.queryOrganizationUser.send({
    'organization_id': organization_id,
    'pageNumber': pageNumber,
    'pageSize': pageSize
  });
}
// export function queryUserCount(organization_id) {
//   return PublicObjService.queryOrganizationUserCount.send({
//     'organization_id': organization_id
//   });
// }
// export function queryOneOrganizationUser(id) {
//   return PublicObjService.queryOneOrganizationUser.send({
//     'id': id
//   });
// }
// export function addOrganizationUser(organizationUser) {
//   return PublicObjService.addOrganizationUser.send(organizationUser);
// }
export function updateOrganizationUser(organizationUser) {
  return PublicObjService.updateOrganizationUser.send(organizationUser);
}
// export function deleteOrganizationUser(id) {
//   return PublicObjService.deleteOrganizationUser.send({
//     'id': id
//   });
// }
// export function seteOrganizationUserRole(user_ids, role_ids) {
//   return PublicObjService.seteOrganizationUserRole.send({
//     'user_ids': user_ids,
//     'role_ids': role_ids
//   });
// }
// export function setUserRegion(uid, rids) {
//   return PublicObjService.setUserRegion.send({
//     'uid': uid,
//     'rids': rids
//   });
// }
// export function modUserOrg(uid, oid) {
//   return PublicObjService.modUserOrg.send({
//     'uid': uid,
//     'oid': oid
//   });
// }
// export function getUserRegion(uid) {
//   return PublicObjService.getUserRegion.send({
//     'uid': uid
//   });
// }
// export function getRoleOfUser(uid) {
//   return PublicObjService.getRoleOfUser.send({
//     'uid': uid
//   });
// }
